<%@ page language="java" pageEncoding="utf8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"
	dir="ltr">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link rel="stylesheet" href="<c:url value="/css/shopadmin.css"/>"
			type="text/css" />
	</head>
	<body style="">
		<div id="headBar" class="head_content"></div>
		<div id="main" class="main_content">
			<form id="add_cat_form" method="post"
				action="page_cat_save.html">
				<input class="x-input " value="${systemArticleCat.catId}"
					name="systemArticleCat.catId" type="hidden" />

				<div class="tableform">
					<div class="division">
						<table border="0" cellpadding="0" cellspacing="0" width="100%">
							<tbody>
								<tr>
									<th>
										文章分类名称：
									</th>
									<td>
										<input class="x-input " value="${systemArticleCat.catName}"
											name="systemArticleCat.catName" type="text" />
									</td>
								</tr>
								<tr>
									<th>
										文章分类类型：
									</th>
									<td>
										<hubaobei:constants scope="request"/> 
										<select id="cat_catType" name="systemArticleCat.catType">
											<c:forEach var="label" items="${ARTICLE_CAT_TYPE}"   >											
											<option value="${label.label}">
												${label.value}
											</option>
											 </c:forEach>
										</select>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<div class="division">
						<table border="0" cellpadding="0" cellspacing="0" width="100%">
							<tbody>
								<tr>
									<th>
										发布：
									</th>
									<td>
										<select id="showInNav" name="systemArticleCat.showInNav">
											<option value="true">
												是
											</option>
											<option value="false">
												否
											</option>
										</select>
									</td>
								</tr>
								<tr>
									<th>
										排序：
									</th>
									<td>
										<input class="x-input " name="systemArticleCat.showOrder"
											style="width: 50px;" value="${systemArticleCat.showOrder}"
											type="text" />
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<div class="table-action">
						<button type="submit" class="btn">
							<span><span>完成</span> </span>
						</button>
					</div>
				</div>
			</form>
		</div>
		<div id="footBar" class="foot_content"></div>



		<div class="foot_content" id="footBar" style="font-size: 0px;"></div>
		<script type="text/javascript"
			src="<c:url value='/scripts/jquery-1.4.2.js'/>"></script>
		<script type="text/javascript"
			src="<c:url value='/scripts/jquery.validate.js'/>"></script>
		<script type="text/javascript">
 
 <c:if test="${not empty systemArticleCat.catId}">
 $('#cat_catType').attr('value','${systemArticleCat.catType}');
 	$('#showInNav').attr('value','${systemArticleCat.showInNav}');
 </c:if>
 
	$(document).ready(function() {
		var validator = $("#add_cat_form").validate( {
			errorElement : "div",
			errorClass : "x-vali-error",
			onfocusout : false,
			rules : {
				'systemArticleCat.catName' : "required",
				'systemArticleCat.showOrder' : {
					required : true,
					number : true
				}
			},
			messages : {
				'systemArticleCat.catName' : "必填字段",
				'systemArticleCat.showOrder' : "请填入数字"
			},
			errorPlacement : function(error, element) {
				element.removeClass('x-vali-error');
				error.appendTo(element.parent());

			},

			success : function(div) {
				$(div).remove();
			}
		});
	});
</script>
	</body>
</html>